#! /usr/bin/env python
# -*- coding:utf-8 -*-
# Author Jmz






class A:
    def __init__(self):
        pass

class A1(A):
    def get(self):
        print('A1')
    @staticmethod
    def cat(self):
        print('我是静态方法')

# issubclass()
if issubclass(A1,A):
    print('A1 是 A 的子类')

# isinstance()
obj = A1()
if isinstance(obj,A1):
    print('obj 是 A1的实例')

# hasattr()
if hasattr(A1,"get"):
    print('A1 存在get 方法会属性')
if hasattr(obj,"get"):
    print('obj实例 存在get 方法会属性')


# setattr()
setattr(A1,"name","jmz")
print(A1.__dict__)
# {'__module__': '__main__', 'get': <function A1.get at 0x00000000025099D8>, '__doc__': None, 'name': 'jmz'}


# getattr()
get_func = getattr(obj,"get")
get_func()
# A1

# delattr
delattr(A1,"name")
print(A1.__dict__)
# {'__module__': '__main__', 'get': <function A1.get at 0x00000000021799D8>, '__doc__': None}


# callable()   #  函数用于检查一个对象是否是可调用的
if not callable(obj):
    print('obj 实例不可再调用了')

if callable(A1):
    print('A1 类可以调用')